package b.p.b;

import androidx.recyclerview.widget.RecyclerView.j;
import androidx.recyclerview.widget.RecyclerView.z;
import b.f.e;
import b.f.h;
import b.i.j.c;

/* compiled from: ViewInfoStore */
public class h0 {
    public final h<z, a> a = new h();
    public final e<z> b = new e(10);

    /* compiled from: ViewInfoStore */
    public static class a {
        public static c<a> d = new c(20);
        public int a;
        public j.c b;
        public j.c c;

        public static a a() {
            a aVar = (a) d.a();
            return aVar == null ? new a() : aVar;
        }

        public static void b(a aVar) {
            aVar.a = 0;
            aVar.b = null;
            aVar.c = null;
            d.b(aVar);
        }
    }

    /* compiled from: ViewInfoStore */
    public interface b {
    }

    public void a(z zVar) {
        a aVar = (a) this.a.getOrDefault(zVar, null);
        if (aVar == null) {
            aVar = a.a();
            this.a.put(zVar, aVar);
        }
        aVar.a |= 1;
    }

    public void b(z zVar, j.c cVar) {
        a aVar = (a) this.a.getOrDefault(zVar, null);
        if (aVar == null) {
            aVar = a.a();
            this.a.put(zVar, aVar);
        }
        aVar.c = cVar;
        aVar.a |= 8;
    }

    public void c(z zVar, j.c cVar) {
        a aVar = (a) this.a.getOrDefault(zVar, null);
        if (aVar == null) {
            aVar = a.a();
            this.a.put(zVar, aVar);
        }
        aVar.b = cVar;
        aVar.a |= 4;
    }

    public boolean d(z zVar) {
        a aVar = (a) this.a.getOrDefault(zVar, null);
        if (aVar == null || (aVar.a & 1) == 0) {
            return false;
        }
        return true;
    }

    public final j.c e(z zVar, int i) {
        int e = this.a.e(zVar);
        if (e < 0) {
            return null;
        }
        a aVar = (a) this.a.k(e);
        if (aVar != null) {
            int i2 = aVar.a;
            if ((i2 & i) != 0) {
                j.c cVar;
                int i3 = (~i) & i2;
                aVar.a = i3;
                if (i == 4) {
                    cVar = aVar.b;
                } else if (i == 8) {
                    cVar = aVar.c;
                } else {
                    throw new IllegalArgumentException("Must provide flag PRE or POST");
                }
                if ((i3 & 12) == 0) {
                    this.a.i(e);
                    a.b(aVar);
                }
                return cVar;
            }
        }
        return null;
    }

    public void f(z zVar) {
        a aVar = (a) this.a.getOrDefault(zVar, null);
        if (aVar != null) {
            aVar.a &= -2;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:14:? A:{SYNTHETIC, RETURN} */
    /* JADX WARNING: Removed duplicated region for block: B:10:0x002e  */
    public void g(androidx.recyclerview.widget.RecyclerView.z r7) {
        /*
        r6 = this;
        r0 = r6.b;
        r0 = r0.i();
        r1 = 1;
        r0 = r0 - r1;
    L_0x0008:
        if (r0 < 0) goto L_0x0024;
    L_0x000a:
        r2 = r6.b;
        r2 = r2.j(r0);
        if (r7 != r2) goto L_0x0021;
    L_0x0012:
        r2 = r6.b;
        r3 = r2.c;
        r4 = r3[r0];
        r5 = b.f.e.e;
        if (r4 == r5) goto L_0x0024;
    L_0x001c:
        r3[r0] = r5;
        r2.a = r1;
        goto L_0x0024;
    L_0x0021:
        r0 = r0 + -1;
        goto L_0x0008;
    L_0x0024:
        r0 = r6.a;
        r7 = r0.remove(r7);
        r7 = (b.p.b.h0.a) r7;
        if (r7 == 0) goto L_0x0031;
    L_0x002e:
        b.p.b.h0.a.b(r7);
    L_0x0031:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.p.b.h0.g(androidx.recyclerview.widget.RecyclerView$z):void");
    }
}
